package city.spring.modules.medicine.repository;

import city.spring.modules.medicine.entity.MedicinedeliveryMedicineExtEntity;
import city.spring.modules.medicine.vo.MedicinedeliveryMedicineVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：药品出库与药品关联表
 *
 * @author 谢金婷
 * @date 2020-07-08 16:17:05
 */
@Repository
public interface MedicinedeliveryMedicineExtRepository extends BaseMapper<MedicinedeliveryMedicineExtEntity> {
    /**
     * 获取出库的药品列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<MedicinedeliveryMedicineVO> getMedicines(@Param(Constants.WRAPPER) Wrapper<? extends MedicinedeliveryMedicineExtEntity> wrapper);

    /**
     * 获取出库的药品列表
     *
     * @param deliveryId 出库单ID
     * @return
     */
    List<MedicinedeliveryMedicineVO> getDeliveryMedicines(Integer deliveryId);

    /**
     * 获取出库的某个药品
     *
     * @param deliveryId 排班方案ID
     * @param extId      主键ID
     * @return
     */
    MedicinedeliveryMedicineVO getDeliveryMedicine(Integer deliveryId, Integer extId);

    /**
     * 获取出库的药品列表
     *
     * @param deliveryId 出库单ID
     * @return
     */
    List<MedicinedeliveryMedicineExtEntity> getDeliveryMts(Integer deliveryId);

    /**
     * 查找该deliveryId下的药品出库信息
     *
     * @param deliveryId
     * @return
     */
    List<MedicinedeliveryMedicineExtEntity> getByDeliveryId(String deliveryId);
}